package jupiter.filters;
import org.json.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class FilterException extends Exception {
	public JSONObject json;
	public String json_string;
	private boolean releaseContinuation = true;
	static Logger logger = LoggerFactory.getLogger(FilterException.class);
	// called when resuming a session, passed a valid json_string
	public FilterException(String m, boolean release){
		super();
		json_string = m;
		releaseContinuation= release;
	}
	public FilterException(JSONObject o, boolean release){
		super();
		json = o;
		releaseContinuation= release;
	}
	public FilterException(JSONObject o){
		super();
		json = o;
	}
	public FilterException(){
		super();
		json = new JSONObject();
	}
	public FilterException(String m){
		super();
		try{
			json = new JSONObject(m);
		}catch(JSONException e){
			FilterException.logger.error("Can't parse message",e);
		}
		releaseContinuation = true;
	}
	
	public boolean releaseContinuation(){
		return releaseContinuation;
	}
}
